home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / CONFIG.H < prev    next >
C/C++ Source or Header  |  1992-05-04  |  17KB  |  581 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/src/microcode/RCS/config.h,v 9.71 1992/05/05 02:24:38 jinx Exp $
  4.  
  5. Copyright (c) 1987-1992 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. /* This file contains the configuration information and the information
  36.    given on the command line on Unix. */
  37.  
  38. /* Default pathnames. */
  39.  
  40. #ifndef butterfly
  41. #ifndef unix
  42. /* On unix, these are part of the make file. */
  43.  
  44. /* Runtime debugging flags, with appropriate defaults: */
  45.  
  46. /* To debug the interpreter code itself, define ENABLE_DEBUGGING_TOOLS */
  47. /* #define ENABLE_DEBUGGING_TOOLS */
  48.  
  49. /* If runtime HISTORY recording (a Scheme code debugging tool) is not
  50.    desired. */
  51. /* #define DISABLE_HISTORY */
  52.  
  53. /* To enable the STEPPER.  Incompatible with futures. */
  54. #define COMPILE_STEPPER 
  55.  
  56. /* To enable FUTURES (a multiprocessor / multiprocessing extension).
  57.    This option is incompatible with the stepper.
  58.    Future.c must also be compiled. */
  59. /* #define COMPILE_FUTURES */
  60.  
  61. /* To enable stacklets (mostly useful with FUTURES).  These allow the
  62.    stack to be allocated in small chunks from the heap, rather than
  63.    in a single contiguous area at start up time. The use of the this
  64.    option is incompatible with the stepper and compiler. */
  65.  
  66. /* #define USE_STACKLETS */
  67. #endif
  68. #endif
  69.  
  70. /* Some configuration consistency testing */
  71.  
  72. #ifdef COMPILE_STEPPER
  73. #ifdef COMPILE_FUTURES
  74. #include "Error: Futures and stepping are not currently compatible."
  75. #endif
  76. #endif
  77.  
  78. #ifdef USE_STACKLETS
  79. #ifdef COMPILE_STEPPER
  80. #include "Error: The stepper doesn't work with stacklets."
  81. #endif
  82. #endif
  83.  
  84. /* For use in the C pre-processor, not in code! */
  85. #define FALSE            0
  86. #define TRUE            1
  87.  
  88. /* These C type definitions are needed by everybody.
  89.    They should not be here, but it is unavoidable. */
  90. typedef char Boolean;
  91. #define true            ((Boolean) TRUE)
  92. #define false            ((Boolean) FALSE)
  93.  
  94. /* This is the Scheme object type.
  95.    The various fields are defined in "object.h". */
  96. typedef unsigned long SCHEME_OBJECT;
  97. #define OBJECT_LENGTH (CHAR_BIT * (sizeof (unsigned long)))
  98.  
  99. /* Operating System / Machine dependencies:
  100.  
  101.    For each implementation, be sure to specify FASL_INTERNAL_FORMAT.
  102.    Make sure that there is an appropriate FASL_<machine name>.
  103.    If there isn't, add one to the list below.
  104.  
  105.    If you do not know the values of the parameters specified below,
  106.    try compiling and running the Wsize program ("make Wsize" if on a
  107.    unix variant).  It may not run, but if it does, it will probably
  108.    compute the correct information.
  109.  
  110.    Note that the C type void is used in the sources.  If your version
  111.    of C does not have this type, you should bypass it.  This can be
  112.    done by inserting the preprocessor command '#define void' in this
  113.    file, under the heading for your kind of machine.
  114.  
  115.    These parameters MUST be specified (and are computed by Wsize):
  116.  
  117.    CHAR_BIT is the size of a character in bits.
  118.  
  119.    FLOATING_ALIGNMENT should be defined ONLY if the system requires
  120.    floating point numbers (double) to be aligned more strictly than
  121.    SCHEME_OBJECTs (unsigned long).  The value must be a mask of the
  122.    low order bits which are required to be zero for the storage
  123.    address.  For example, a value of 0x7 requires octabyte alignment
  124.    on a machine where addresses are specified in bytes.  The alignment
  125.    must be an integral multiple of the length of a long.
  126.  
  127.    VAX_BYTE_ORDER should be defined ONLY if the least significant byte
  128.    of a longword in memory lies at the lowest address, not defined
  129.    otherwise (i.e. Motorola MC68020, with opposite convention, or
  130.    PDP-10 with word addressing).
  131.  
  132.    Other flags (the safe option is NOT to define them, which will
  133.    sacrifice speed for safety):
  134.  
  135.    HEAP_IN_LOW_MEMORY should be defined if malloc returns the lowest
  136.    available memory and thus all addresses will fit in the datum portion
  137.    of a Scheme object.  The datum portion of a Scheme object is 8 bits
  138.    less than the length of a C long.
  139.  
  140.    b32 says that objects are 32 bits long.  The information is
  141.    redundant, but some C compilers do not do constant folding when
  142.    shifts are involved, so it sometimes makes a big difference to
  143.    define the constants directly rather than in terms of other
  144.    constants.  Similar things can be done for other word sizes.
  145.  
  146.    The following switches say whether to use the system-provided
  147.    library routines rather than the emulated versions in the Scheme
  148.    sources.  The library routines should be more accurate and probably
  149.    more efficient.
  150.  
  151.    HAS_FLOOR should be defined if the system has the double-precision
  152.    procedures floor and ceil.  On Unix, look for floor(3M).
  153.  
  154.    HAS_FREXP should be defined if the system has the double-precision
  155.    procedures ldexp and frexp.  On Unix, look for frexp(3C).
  156.  
  157.    HAS_MODF should be defined if the system has the double-precision
  158.    procedure modf.  On Unix, look for frexp(3C).  **** This flag is
  159.    new as of 22-SEP-89; please comment out any incorrect #define's as
  160.    we haven't been able to test this on all machines.
  161.  
  162. */
  163.  
  164. /* Possible values for FASL_INTERNAL_FORMAT.  For the most part this
  165.    means the processor type, so for example there are several aliases
  166.    for 68000 family processors.  This scheme allows sharing of
  167.    compiled code on machines with the same processor type.  Probably
  168.    we will have to create a more powerful method of identifying FASL
  169.    files when we introduce new differences, such as whether or not a
  170.    68881 coprocessor is installed. */
  171.  
  172. #define FASL_UNKNOWN        0
  173. #define FASL_PDP10        1
  174. #define FASL_VAX        2
  175. #define FASL_68020        3
  176. #define FASL_68000          4
  177. #define FASL_HP_9000_500    5
  178. #define FASL_I386        6
  179. #define FASL_BFLY        7
  180. #define FASL_CYBER        8
  181. #define FASL_CELERITY        9
  182. #define FASL_HP_SPECTRUM    10
  183. #define FASL_UMAX        11
  184. #define FASL_PYR        12
  185. #define FASL_ALLIANT        13
  186. #define FASL_SPARC        14
  187. #define FASL_MIPS        15
  188. #define FASL_APOLLO_68K        16
  189. #define FASL_APOLLO_PRISM    17
  190. #define FASL_ALPHA        18
  191.  
  192. #ifdef vax
  193.  
  194. /* Amazingly unix and vms agree on all these */
  195.  
  196. #define MACHINE_TYPE        "vax"
  197. #define FASL_INTERNAL_FORMAT    FASL_VAX
  198. #define VAX_BYTE_ORDER
  199. #define b32
  200. #define HEAP_IN_LOW_MEMORY
  201. #define HAS_FLOOR
  202. #define HAS_FREXP
  203. #define HAS_MODF
  204.  
  205. /* Not on these, however */
  206.  
  207. #ifdef vms
  208.  
  209. #define VMS_VERSION        4
  210. #define VMS_SUBVERSION        5
  211.  
  212. /* If your C runtime library already defines the `tbuffer' datatype,
  213.    then define this symbol. */
  214. /* #define HAVE_TBUFFER */
  215.  
  216. /* Name conflict in VMS with system variable */
  217. #define Free            Free_Register
  218.  
  219. #if (VMS_VERSION < 4)
  220. /* Pre version 4 VMS has no void type. */
  221. #define void
  222. #endif /* VMS_VERSION */
  223.  
  224. /* This eliminates a spurious warning from the C compiler. */
  225. #define main_type
  226.  
  227. /* exit(0) produces horrible message on VMS */
  228. #define NORMAL_EXIT 1
  229.  
  230. #define EXIT_SCHEME_DECLARATIONS static jmp_buf exit_scheme_jmp_buf
  231.  
  232. #define INIT_EXIT_SCHEME()                        \
  233. {                                    \
  234.   int which_way = (setjmp (exit_scheme_jmp_buf));            \
  235.   if (which_way == NORMAL_EXIT)                        \
  236.     return;                                \
  237. }
  238.  
  239. #define EXIT_SCHEME(value)                        \
  240. {                                    \
  241.   if (value != 0)                            \
  242.     exit (value);                            \
  243.   longjmp (exit_scheme_jmp_buf, NORMAL_EXIT);                \
  244. }
  245.  
  246. #else /* not vms */
  247.  
  248. /* Vax Unix C compiler bug */
  249. #define HAVE_DOUBLE_TO_LONG_BUG
  250.  
  251. #endif /* not vms */
  252. #endif /* vax */
  253.  
  254. #if defined(hpux) || defined(__hpux)
  255.  
  256. #define HAS_FLOOR
  257. #define HAS_FREXP
  258. #define HAS_MODF
  259.  
  260. #if defined(hp9000s300) || defined(__hp9000s300)
  261. #if defined(hp9000s400) || defined(__hp9000s400)
  262. #define MACHINE_TYPE        "hp9000s400"
  263. #else
  264. #define MACHINE_TYPE        "hp9000s300"
  265. #endif
  266. #ifdef MC68010
  267. #define FASL_INTERNAL_FORMAT    FASL_68000
  268. #else
  269. #define FASL_INTERNAL_FORMAT    FASL_68020
  270. #endif
  271. #define b32
  272. #define HEAP_IN_LOW_MEMORY
  273. #endif /* hp9000s300 */
  274.  
  275. #if defined(hp9000s800) || defined(__hp9000s800)
  276. #if defined(hp9000s700) || defined(__hp9000s700)
  277. #define MACHINE_TYPE        "hp9000s700"
  278. #else
  279. #define MACHINE_TYPE        "hp9000s800"
  280. #endif
  281. #define FASL_INTERNAL_FORMAT    FASL_HP_SPECTRUM
  282. #define FLOATING_ALIGNMENT    0x7
  283. #define b32
  284.  
  285. /* Heap resides in data space, pointed at by space register 5.
  286.    Short pointers must have their high two bits set to 01 so that
  287.    it is interpreted as space register 5, 2nd quadrant.
  288.  
  289.    This is kludged by the definitions below, and is still considered
  290.    HEAP_IN_LOW_MEMORY.  */
  291.  
  292. #define HEAP_IN_LOW_MEMORY
  293.  
  294. /* data segment bits and mask for all bits */
  295.  
  296. #define HPPA_QUAD_BIT    0x40000000
  297. #define HPPA_QUAD_MASK    0xC0000000
  298.  
  299. #define DATUM_TO_ADDRESS(datum)                        \
  300.   ((SCHEME_OBJECT *) (((unsigned long) (datum)) | HPPA_QUAD_BIT))
  301.  
  302. #define ADDRESS_TO_DATUM(address)                    \
  303.   ((SCHEME_OBJECT) (((unsigned long) (address)) & (~(HPPA_QUAD_MASK))))
  304.  
  305. #endif /* hp9000s800 */
  306.  
  307. #ifdef hp9000s500
  308. #define MACHINE_TYPE        "hp9000s500"
  309. #define FASL_INTERNAL_FORMAT     FASL_HP_9000_500
  310. #define b32
  311.  
  312. /* An unfortunate fact of life on this machine:
  313.    the C heap is in high memory thus HEAP_IN_LOW_MEMORY is not
  314.    defined and the whole thing runs slowly.  */
  315.  
  316. /* C Compiler bug when constant folding and anchor pointing */
  317. #define And2(x, y)    ((x) ? (y) : false)
  318. #define And3(x, y, z)    ((x) ? ((y) ? (z) : false) : false)
  319. #define Or2(x, y)    ((x) ? true : (y))
  320. #define Or3(x, y, z)    ((x) ? true : ((y) ? true : (z)))
  321.  
  322. #endif /* hp9000s500 */
  323.  
  324. #endif /* hpux */
  325.  
  326. #ifdef sparc
  327. #define MACHINE_TYPE        "sun4"
  328. #define FASL_INTERNAL_FORMAT    FASL_SPARC
  329. #define FLOATING_ALIGNMENT    0x7
  330. #define b32
  331. #define HEAP_IN_LOW_MEMORY
  332. #define HAS_FLOOR
  333. #define HAS_FREXP
  334. #define HAS_MODF
  335. #define HAVE_DOUBLE_TO_LONG_BUG
  336. #endif
  337.  
  338. #ifdef sun3
  339. #define MACHINE_TYPE        "sun3"
  340. #define FASL_INTERNAL_FORMAT    FASL_68020
  341. #define b32
  342. #define HEAP_IN_LOW_MEMORY
  343. #define HAS_FLOOR
  344. #define HAS_FREXP
  345. #define HAS_MODF
  346. #define HAVE_DOUBLE_TO_LONG_BUG
  347. #endif
  348.  
  349. #ifdef sun2
  350. #define MACHINE_TYPE        "sun2"
  351. #define FASL_INTERNAL_FORMAT    FASL_68000
  352. #define b32
  353. #define HEAP_IN_LOW_MEMORY
  354. #define HAS_FLOOR
  355. #define HAS_FREXP
  356. #define HAS_MODF
  357. #define HAVE_DOUBLE_TO_LONG_BUG
  358. #endif
  359.  
  360. #ifdef NeXT
  361. #define MACHINE_TYPE        "next"
  362. #define FASL_INTERNAL_FORMAT    FASL_68020
  363. #define b32
  364. #define HEAP_IN_LOW_MEMORY
  365. #define HAS_FLOOR
  366. #define HAS_FREXP
  367. #define HAS_MODF
  368. #endif
  369.  
  370. #ifdef i386
  371.  
  372. #define FASL_INTERNAL_FORMAT    FASL_I386
  373. #define VAX_BYTE_ORDER
  374. #define b32
  375.  
  376. #ifdef sequent
  377. #  define MACHINE_TYPE        "sequent386"
  378. #endif
  379.  
  380. #ifdef sun
  381. #  define MACHINE_TYPE        "sun386i"
  382. #endif
  383.  
  384. #ifndef MACHINE_TYPE
  385. #  define MACHINE_TYPE        "i386/i486"
  386. #endif
  387.  
  388. /* These are really OS-dependent.
  389.    They are correct for the sequent, SYSV3, DOS (Zortech),
  390.    but we don't know about other 386 systems. 
  391.  */
  392.  
  393. #define HEAP_IN_LOW_MEMORY
  394.  
  395. /* Bug in Mach 3.0 for 386s floating point library. */
  396. #ifndef _MACH_UNIX
  397. #  define HAS_FLOOR
  398. #  define HAS_FREXP
  399. #  define HAS_MODF
  400. #endif
  401.  
  402. #endif /* i386 */
  403.  
  404. #ifdef mips
  405.  
  406. #define MACHINE_TYPE        "mips"
  407. #define FASL_INTERNAL_FORMAT    FASL_MIPS
  408. #define FLOATING_ALIGNMENT       0x7
  409. #define b32
  410.  
  411. #ifdef ultrix
  412. #define VAX_BYTE_ORDER
  413. #else
  414. #ifdef MIPSEL
  415. #define VAX_BYTE_ORDER
  416. #endif
  417. #endif
  418.  
  419. #ifdef sony
  420. #define HAS_FLOOR
  421. #define HAS_FREXP
  422. #define HAS_MODF
  423. #endif
  424.  
  425. /* Heap resides in data space which begins at 0x10000000. This is
  426.    kludged by the definitions below, and is still considered
  427.    HEAP_IN_LOW_MEMORY.  */
  428.  
  429. #define HEAP_IN_LOW_MEMORY
  430. #define MIPS_DATA_BIT    0x10000000
  431.  
  432. #define DATUM_TO_ADDRESS(datum)                        \
  433.   ((SCHEME_OBJECT *) (((unsigned long) (datum)) | MIPS_DATA_BIT))
  434.  
  435. #define ADDRESS_TO_DATUM(address)                    \
  436.   ((SCHEME_OBJECT) (((unsigned long) (address)) & (~(MIPS_DATA_BIT))))
  437.  
  438. /* MIPS compiled binaries are large! */
  439. #ifdef HAS_COMPILER_SUPPORT
  440.  
  441. #ifndef DEFAULT_SMALL_CONSTANT
  442. #define DEFAULT_SMALL_CONSTANT 700
  443. #endif
  444.  
  445. #ifndef DEFAULT_LARGE_CONSTANT
  446. #define DEFAULT_LARGE_CONSTANT 1500
  447. #endif
  448.  
  449. #endif /* HAS_COMPILER_SUPPORT */
  450.  
  451. #endif /* mips */
  452.  
  453. #ifdef alpha
  454. #define MACHINE_TYPE           "Alpha"
  455. #define FASL_INTERNAL_FORMAT   FASL_ALPHA
  456.  
  457. /* The ASCII character set is used. */
  458. #define HEAP_IN_LOW_MEMORY     1
  459. /* unsigned longs use logical shifting. */
  460. #define VAX_BYTE_ORDER         1
  461.  
  462. /* Flonums have no special alignment constraints. */
  463. #define FLONUM_MANTISSA_BITS   53
  464. #define FLONUM_EXPT_SIZE       10
  465. #define MAX_FLONUM_EXPONENT    1023
  466. /* Floating point representation uses hidden bit. */
  467. #define HAS_FLOOR
  468. /* #define HAS_FREXP */
  469. #define HAS_MODF
  470. #endif /* alpha */
  471.  
  472. /* These (pdp10, nu) haven't worked in a while.
  473.    Should be upgraded or flushed some day.  */
  474.  
  475. #ifdef pdp10
  476. #define MACHINE_TYPE        "pdp10"
  477. #define FASL_INTERNAL_FORMAT    FASL_PDP10
  478. #define HEAP_IN_LOW_MEMORY
  479. #define CHAR_BIT 36        / * Ugh! Supposedly fixed in newer Cs * /
  480. #define UNSIGNED_SHIFT_BUG
  481. #endif /* pdp10 */
  482.  
  483. #ifdef nu
  484. #define MACHINE_TYPE        "nu"
  485. #define FASL_INTERNAL_FORMAT    FASL_68000
  486. #define b32
  487. #define HEAP_IN_LOW_MEMORY
  488. #define HAS_FREXP
  489. #define UNSIGNED_SHIFT_BUG
  490. #endif /* nu */
  491.  
  492. /* These are pretty old too, but more recent versions have run. */
  493.  
  494. #ifdef butterfly
  495. #define MACHINE_TYPE        "butterfly"
  496. #define FASL_INTERNAL_FORMAT    FASL_BFLY
  497. #define b32
  498. #define HEAP_IN_LOW_MEMORY
  499. #include <public.h>
  500. #define HAS_FREXP
  501. #define HAS_MODF
  502. #endif
  503.  
  504. #ifdef cyber180
  505. #define MACHINE_TYPE        "cyber180"
  506. #define FASL_INTERNAL_FORMAT    FASL_CYBER
  507. #define HEAP_IN_LOW_MEMORY
  508. #define UNSIGNED_SHIFT_BUG
  509. /* The Cyber180 C compiler manifests a bug in hairy conditional expressions */
  510. #define Conditional_Bug
  511. #endif /* cyber180 */
  512.  
  513. #ifdef celerity
  514. #define MACHINE_TYPE        "celerity"
  515. #define FASL_INTERNAL_FORMAT    FASL_CELERITY
  516. #define b32
  517. #define HEAP_IN_LOW_MEMORY
  518. #endif /* celerity */
  519.  
  520. #ifdef umax
  521. #define MACHINE_TYPE        "umax"
  522. #define FASL_INTERNAL_FORMAT    FASL_UMAX
  523. #define VAX_BYTE_ORDER
  524. #define b32
  525. #define HEAP_IN_LOW_MEMORY
  526. #define HAS_FLOOR
  527. #define HAS_FREXP
  528. #define HAS_MODF
  529. #endif /* umax */
  530.  
  531. #ifdef pyr
  532. #define MACHINE_TYPE        "pyramid"
  533. #define FASL_INTERNAL_FORMAT    FASL_PYR
  534. #define b32
  535. #define HEAP_IN_LOW_MEMORY
  536. #endif /* pyr */
  537.  
  538. #ifdef alliant
  539. #define MACHINE_TYPE        "alliant"
  540. #define FASL_INTERNAL_FORMAT    FASL_ALLIANT
  541. #define b32
  542. #define HEAP_IN_LOW_MEMORY
  543. #define HAS_FLOOR
  544. #define HAS_FREXP
  545. #define HAS_MODF
  546. #endif /* alliant */
  547.  
  548. #ifdef apollo
  549. #if _ISP__M68K
  550. #define MACHINE_TYPE          "Apollo 68k"
  551. #define FASL_INTERNAL_FORMAT  FASL_APOLLO_68K
  552. #else
  553. #define MACHINE_TYPE          "Apollo Prism"
  554. #define FASL_INTERNAL_FORMAT  FASL_APOLLO_PRISM
  555. #endif
  556. #define b32
  557. #define HEAP_IN_LOW_MEMORY
  558. #define HAS_FLOOR
  559. #define HAS_FREXP
  560. #endif /* apollo */
  561.  
  562. /* Make sure that some definition applies.  If this error occurs, and
  563.    the parameters of the configuration are unknown, try the Wsize
  564.    program.  */
  565. #ifndef MACHINE_TYPE
  566. #include "Error: config.h: Unknown configuration."
  567. #endif
  568.  
  569. /* Virtually all machines have 8-bit characters these days, so don't
  570.    explicitly specify this value unless it is different.  */
  571. #ifndef CHAR_BIT
  572. #define CHAR_BIT 8
  573. #endif
  574.  
  575. /* The GNU C compiler does not have any of these bugs. */
  576. #ifdef __GNUC__
  577. #undef HAVE_DOUBLE_TO_LONG_BUG
  578. #undef UNSIGNED_SHIFT_BUG
  579. #undef Conditional_Bug
  580. #endif
  581.